<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="Bookmark" href="/favicon.ico">
	<link rel="Shortcut Icon" href="/favicon.ico" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="http://www.bxd.com/Public/shop/lib/lib/html5.js"></script>
	<script type="text/javascript" src="http://www.bxd.com/Public/shop/lib/lib/respond.min.js"></script>
	<script type="text/javascript" src="http://www.bxd.com/Public/shop/lib/lib/PIE_IE678.js"></script>
	<![endif]-->
	<link href="http://www.bxd.com/Public/shop/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="http://www.bxd.com/Public/shop/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="http://www.bxd.com/Public/shop/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
	<link href="http://www.bxd.com/Public/shop/css/style.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]>
	<script type="text/javascript" src="http://www.bxd.com/Public/shop/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script>
	<![endif]-->
	<title>基础信息</title>
</head>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 
		首页 <span class="c-gray en">&gt;</span> 
		商户信息 <span class="c-gray en">&gt;</span> 
		基础信息 
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
<div class="pd-20">
	<form action="http://www.bxd.com/Bshop/Account/save_basc_shop" class="form form-horizontal" method="post" id="form1">
	<div id="systab">
			<div class="tabBar cl">
				<span>商户信息</span>
				<span>图文介绍</span>
			</div>
			<div class="tabCon">
				<input type="hidden" name="logo" id="logohidden" value="<?php echo ($va["logo"]); ?>"/>
				<input type="hidden" name="username"  value="<?php echo ($va["username"]); ?>"/>
				<input type="hidden" name="id"  value="<?php echo ($va["id"]); ?>"/>
				<div class="row cl">
					<label class="form-label col-2">头像:</label>
					<div class="formControls col-10 layer-image">
						<div class="headimg">
						<?php if($va["logo"] == null): ?><img src="http://www.bxd.com/Public/shop/img/logo.png" alt="" id="logoimg"/>
						<?php else: ?>
						<img src="<?php echo ($va["logo"]); ?>" alt="" id="logoimg"/><?php endif; ?>
						
						</div>
						<button type="button" class="btn bnt-small btn-secondary-outline radius" onclick="layer_show('更改logo','http://www.bxd.com/Bshop/reuse/uploadimagesfile/type/3/width/120/height/120')">上传</button>
					    <span class="c-red">请上传图片的尺寸为120*120</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2">公司名称(同营业执照):</label>
					<div class="formControls col-10">
						 <input type="text" name="shop_name" id="" datatype="*" nullmsg="请输入商户名称" class="input-text" <?php if($va["shop_name"] != null and $_POST == null): ?>readonly="readonly"<?php endif; ?> value="<?php echo ($va["shop_name"]); ?>" style="width:250px"/>
					     <span class="c-red">*一经填写，就不可修改</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2">简称(门店名称):</label>
					<div class="formControls col-4">
						<input type="text" value="<?php echo ($va["small_name"]); ?>" id="" datatype="*" nullmsg="请输入简称" class="input-text" name="small_name" <?php if($va["small_name"] != null and $_POST == null): ?>readonly="readonly"<?php endif; ?> style="width:250px"/>
					    <span class="c-red">*一经填写，就不可修改</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2">区域:</label>
					<div class="formControls col-10">
						<span class="select-box inline">
						<select name="provinceid" id="province" class="select" onchange="selectchange('http://www.bxd.com/Bshop/Reuse/selectcity','province','city')">
						    <option value="">请选择</option>
						    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["id"]); ?>" <?php if($va['provinceid'] == $vo['id']): ?>selected="selected"<?php endif; ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
						</select></span>省
						<span class="select-box inline">
						<select name="cityid" id="city" class="select" onchange="selectchange('http://www.bxd.com/Bshop/Reuse/selectcity','city','area')">
						<?php if($va["cityid"] != null): ?><option value="<?php echo ($va["cityid"]); ?>"><?php echo area_name($va['cityid']);?></option><?php endif; ?>
						</select>
						</span>市
						<span class="select-box inline">
						<select name="areaid" id="area" class="select">
						<?php if($va["areaid"] != null): ?><option value="<?php echo ($va["areaid"]); ?>"><?php echo area_name($va['areaid']);?></option><?php endif; ?>
						</select>
						</span>区
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2">地址:</label>
					<div class="formControls col-5">
						<input type="text" name="shop_address" id="" datatype="*" nullmsg="请输入地址" class="input-text" value="<?php echo ($va["shop_address"]); ?>"/>
					</div>
				</div>
				<div class="row cl">
				    <label class="form-label col-2">经纬度:</label>
					<div class="formControls col-10">
						<input type="text" name="east" id="" datatype="*" class="input-text" style="width:350px;" <?php if($va["north"] != null): ?>value="<?php echo ($va["east"]); ?>,<?php echo ($va["north"]); ?>"<?php endif; ?> />
						<a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank">获取经纬度</a>
					</div>
					<!-- <div class="formControls col-5">
						<label for="">北纬:</label>
						<input type="text" name="north" id="" datatype="*" class="input-text" style="width:150px;" value="<?php echo ($va["north"]); ?>"/>
						<a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank">获取坐标</a>
					</div> -->
				</div>
				<div class="row cl">
					<label class="form-label col-2">联系人:</label>
					<div class="formControls col-10">
						<input type="text" name="people" id="" datatype="*" class="input-text" value="<?php echo ($va["people"]); ?>" style="width:250px"/>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2">联系电话:</label>
					<div class="formControls col-10">
						<input type="text" name="phone" id="" datatype="/^((\d{3,4}-)*\d{7,8}(-\d{3,4})*|(1)\d{10})$/" nullmsg="请输入联系电话" errormsg="电话/手机格式错误" class="input-text" value="<?php echo ($va["phone"]); ?>" maxlength="13" style="width:250px"/>
					</div>
				</div>
				<!-- <div class="row cl">
					<label class="form-label col-2">电子邮箱:</label>
					<div class="formControls col-10">
						<input type="text" name="email" id="" datatype="e" errormsg="邮箱格式错误" nullmsg="请输入电子邮箱" class="input-text" value="<?php echo ($va["email"]); ?>" style="width:250px"/>
					</div>
				</div> -->
			</div>
			<div class="tabCon">
					<div class="mt-20">
						<textarea name="body" class="textarea" ><?php echo ($va["body"]); ?></textarea>
					</div>
			</div>
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button class="btn btn-primary radius" type="submit">
					<i class="Hui-iconfont">&#xe632;</i> 保存
				</button>
			</div>
		</div>
	</div>
</form>	
</div>
<script type="text/javascript" src="http://www.bxd.com/Public/shop/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://www.bxd.com/Public/shop/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="http://www.bxd.com/Public/shop/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="http://www.bxd.com/Public/shop/js/H-ui.js"></script>
<script type="text/javascript" src="http://www.bxd.com/Public/shop/js/H-ui.admin.js"></script>
<!-- <script type="text/javascript" src="__ADMIN__/js/function.js?w=123456465"></script> -->
<script type="text/javascript">
	$(function (){
		$.Huitab("#systab .tabBar span","#systab .tabCon","current","click","0");
	})
	function upLoadedsCallback(file, res){
		//layer.closeAll();
		//上传完所得回调
		if(res.code == 200){
			$("#logoimg").attr("src",res.msg);
			$("#logohidden").val(res.msg);
		}else{
			layer.alert(res.msg);
		}
		//console.log( res );
	}
	window.upLoadedsCallback = upLoadedsCallback;
	/***
	 * 下拉框选择
	 */ 
	function selectchange(url,oneid,twoid,circleurl){
		var one = $("#"+oneid).val();
		var two = $("#"+twoid);
		$.ajax({
			type:"post",
			url:url,
			data:{"id":one},
			dataType:"json",
			success:function(e){
				if(e.code==200){
					two.empty().append('<option value="">请选择</option>');
					var f = e['msg'];
					for(var i in f ){
						two.append('<option value="'+f[i].id+'">'+f[i].name+'</option>');
					}
					if(circleurl){
						selectcircle(circleurl,oneid);
					}
				}else{
					layer.msg(e.msg);
				}
			},error:function(){
				layer.msg('网络错误');
			}
		})
	}

<?php if($va["logo"] != null): ?>layer.config({
  extend: 'extend/layer.ext.js'
});
layer.ready(function() {
	layer.photos({
	    photos: '.layer-image'
	});
});<?php endif; ?>
</script>
<script>
$('#form1').Validform({
	tiptype:3,
	ignoreHidden:true,
	tipSweep:true
});
</script>
</body>
</html>